package com.model.dome1;

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;

public class dateDome {
    public static void main(String[] args) {

//        LocalDate localDate1 = LocalDate.of(2020, 1, 1);
//        LocalDate localDate2 = LocalDate.of(2021, 12, 15);
//        Period period = Period.between(localDate1,localDate2);
//        System.out.println(period.getYears());
//        System.out.println(period.getMonths());
//        System.out.println(period.getDays());
//        System.out.println(period.toTotalMonths());

        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);

        LocalDateTime localDateTime1 = LocalDateTime.of(2020, 1, 1, 15, 34, 1);
        LocalDateTime localDateTime2 = LocalDateTime.of(2050, 10, 12, 20, 52, 1);

        Duration duration = Duration.between(localDateTime1, localDateTime2);

        System.out.println(duration.getSeconds());
        System.out.println(duration.toDays());
        System.out.println(duration.toMillis());
        System.out.println(duration.toNanos());
        System.out.println(duration.toHours());

    }
}
